s=input().split(',')
a=set()
b=[]
for i in s:
    if i not in a:
        a.add(i)
        b.append(i)
print(b)
print(a)

